package com.spzx.product.api;

import com.spzx.product.api.factory.RemoteProductFallbackFactory;
import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.domain.ProductSkuVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(
        contextId = "remoteProductService",//为客户端提供唯一标识
        value = ServiceNameConstants.PRODUCT_SERVICE,//调用的远端服务名称
        fallbackFactory = RemoteProductFallbackFactory.class//服务降级的实现类

)
public interface RemoteProductService {
    @GetMapping("/productSku/getProductSku/{skuId}")
    R<ProductSkuVo> getProductSku(@PathVariable("skuId") Long skuId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
